import 'package:flutter/material.dart';

class HeadTitleWidget extends StatelessWidget {
  final String title;

  //是否选中
  final bool isSelect;

  final Function onTab;

  HeadTitleWidget(this.title, this.isSelect, {this.onTab});

  @override
  Widget build(BuildContext context) {
    Color currentColor = Colors.white;
    if (isSelect) {
      currentColor = Colors.red;
    }
    return InkWell(
      onTap: onTab,
      child: Container(
        padding: EdgeInsets.only(left: 12, right: 12),
        child: Text(
          title,
          style: TextStyle(
              fontWeight: FontWeight.w500, fontSize: 16, color: currentColor),
        ),
      ),
    );
  }
}
